package com.swpu.project.Interceptor;

import com.swpu.project.util.UserHandler;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/*
*  拦截未登录用户
*
* */
public class LoginAutothorityCheckInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        System.out.println("拦截器执行");
        if(UserHandler.getUserDto()==null)
        return  false;

    return true;

    }



}
